package com.example.shuiyin.processors;

import com.example.shuiyin.enums.MediaType;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
public class ProcessorFactory {
    
    private final List<MediaProcessor> processors;
    
    public MediaProcessor getProcessor(MediaType mediaType) {
        return processors.stream()
                .filter(processor -> processor.supportedMediaType() == mediaType)
                .findFirst()
                .orElse(null);
    }
} 